package com.ruoyi.web.wrapper;

import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.ruoyi.account.enums.ActionTypeEnum;
import com.ruoyi.common.wrapper.BaseControllerWrapper;

import java.util.List;
import java.util.Map;

public class AccountMerchantInfoHisWrapper extends BaseControllerWrapper {

    public AccountMerchantInfoHisWrapper(Map<String, Object> single) {
        super(single);
    }

    public AccountMerchantInfoHisWrapper(List<Map<String, Object>> multi) {
        super(multi);
    }

    @Override
    public void wrapTheMap(Map<String, Object> map) {

        try {
            //操作类型
            String actionType = (String) map.get("actionType");
            if (StrUtil.isNotEmpty(actionType)){
                map.put("actionTypeStr", ActionTypeEnum.getNameByValue(actionType));
            }

            if (ObjectUtil.isNotEmpty(actionType)){
                map.put("actionTypeName", ActionTypeEnum.getNameByValue(actionType));
            }

        }catch (Exception ex){
            ex.printStackTrace();
        }
    }
}
